package cn.sc.allinpay.allfavour.business.common.data;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * description：验券券信息
 * author：pany
 * on 2018/8/2 16:10
 */
public class CheckCouponData implements Parcelable {
    private String couponNo;//券号
    private String couponName;//券名称
    private String balance;//余额    单位: 分
    private String unit;//单位
    private int type;//类型    0金额 1抵扣 2计次
    private String discountedAmt;//折现额  单位为分
    private String financialAccount;//财务科目

    private boolean isUse = false;//是否使用 type=0的金额
    private int useNumber = 0;//使用 type=1或2的张数
    private String useAmt;//使用金额，type=0的使用金额

    private String remark;//备注信息

    public CheckCouponData() {

    }

    protected CheckCouponData(Parcel in) {
        couponNo = in.readString();
        couponName = in.readString();
        balance = in.readString();
        unit = in.readString();
        type = in.readInt();
        discountedAmt = in.readString();
        financialAccount = in.readString();
        isUse = in.readByte() != 0;
        useNumber = in.readInt();
        useAmt = in.readString();
        remark = in.readString();
    }

    public String getCouponNo() {
        return couponNo;
    }

    public void setCouponNo(String couponNo) {
        this.couponNo = couponNo;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDiscountedAmt() {
        return discountedAmt;
    }

    public void setDiscountedAmt(String discountedAmt) {
        this.discountedAmt = discountedAmt;
    }

    public String getFinancialAccount() {
        return financialAccount;
    }

    public void setFinancialAccount(String financialAccount) {
        this.financialAccount = financialAccount;
    }

    public boolean isUse() {
        return isUse;
    }

    public void setUse(boolean use) {
        isUse = use;
    }

    public int getUseNumber() {
        return useNumber;
    }

    public void setUseNumber(int useNumber) {
        this.useNumber = useNumber;
    }

    public String getUseAmt() {
        return useAmt;
    }

    public void setUseAmt(String useAmt) {
        this.useAmt = useAmt;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public static final Creator<CheckCouponData> CREATOR = new Creator<CheckCouponData>() {
        @Override
        public CheckCouponData createFromParcel(Parcel in) {
            return new CheckCouponData(in);
        }

        @Override
        public CheckCouponData[] newArray(int size) {
            return new CheckCouponData[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(couponNo);
        parcel.writeString(couponName);
        parcel.writeString(balance);
        parcel.writeString(unit);
        parcel.writeInt(type);
        parcel.writeString(discountedAmt);
        parcel.writeString(financialAccount);
        parcel.writeByte((byte) (isUse ? 1 : 0));
        parcel.writeInt(useNumber);
        parcel.writeString(useAmt);
        parcel.writeString(remark);
    }
}
